﻿using ChiWalker.Dynamics;
using ChiWalker.Helpers;
using ChiWalker.Spell;
using ChiWalker.Utilities;
using Styx;
using Styx.TreeSharp;

namespace ChiWalker.Routines.Monk
{
    internal class Mistweaver
    {
        [Behavior(BehaviorType.Combat | BehaviorType.Pull)]
        [Spec(WoWSpec.MonkMistweaver)]
        [Class(WoWClass.Monk)]
        public static Composite MonkMistweaverDPS()

        {
            return new PrioritySelector(
                Safers.EnsureTarget(),
                WaitFor.WaitForCast(),
                Movement.MoveToLoS(ret => StyxWoW.Me.CurrentTarget),
                Movement.FaceMyTarget(),
                new CastOnSelf(Spell.ManaTea, ret => StyxWoW.Me.ManaPercent <= 90),
                new CastOnMyTarget(Spell.TouchOfDeath,
                    ret => StyxWoW.Me.CurrentTarget.CurrentHealth < StyxWoW.Me.CurrentHealth),
                new CastOnMyTarget(Spell.ChiWave),
                new CastOnMyTarget(Spell.TigerPalm, ret => !StyxWoW.Me.HasAura(Aura.TigerPower)),
                new CastOnMyTarget(Spell.BlackoutKick, ret => StyxWoW.Me.HasAura(Aura.MuscleMemory)),
                new CastOnMyTarget(Spell.Jab),
                Movement.MoveToUnit(ret => StyxWoW.Me.CurrentTarget)
                );
        }
    }
}